﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MLY.Reports.DataReports
{
    public partial class MaterialInQCReport : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CreateReport("1");
            }
        }

        protected void RecreateReport(object sender, EventArgs e)
        {
            CreateReport(DatesTypeDDL.SelectedValue);
        }

        private void CreateReport(string Datetype)
        {
            MaterialInQCDataSource.SelectParameters.Clear();
            MaterialInQCDataSource.SelectParameters.Add("OrganizationId", SessParam.OrganizationId.ToString());
            MaterialInQCDataSource.SelectParameters.Add("DateType", Datetype);

            ReportGrid.DataBind();
        }

        protected void btnXlsExport_Click(object sender, EventArgs e)
        {
            Response.Clear();
            gridExport.WriteXlsToResponse();

        }
        protected void btnXlsxExport_Click(object sender, EventArgs e)
        {
            Response.Clear();
            gridExport.WriteXlsxToResponse();
        }
        protected void btnRtfExport_Click(object sender, EventArgs e)
        {
            Response.Clear();
            gridExport.WriteRtfToResponse();
        }
        protected void btnCsvExport_Click(object sender, EventArgs e)
        {
            gridExport.WriteCsvToResponse();
        }
    }
}
